package service

import (
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

var db *gorm.DB

func InitDB() error {
	dsn := "root:root@tcp(localhost:3306)/newdb?charset=utf8mb4&parseTime=True&loc=Local"
	ldb, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
	db = ldb
	return err
}
